package top.zhan.strategy;

/**
 * @author Zhan
 * @date 2022/10/6 10:28
 */
public class PromotionContext {

    private Strategy strategy;

    public PromotionContext(Strategy strategy){
        this.strategy = strategy;
    }

    /**
     * 根据策略计算最终的价格
     * @param productOrder
     * @return
     */
    public double executeStrategy(ProductOrder productOrder){
        return strategy.computePrice(productOrder);
    }
}
